Skip to content

ci: CPD without compile + changed-modules-only lint lane - #1486

Draft
joaodinissf wants to merge 2 commits into
perf/spotbugs-lane-step-4from
perf/lint-lane-step-5
Draft

ci: CPD without compile + changed-modules-only lint lane#1486
joaodinissf wants to merge 2 commits into
perf/spotbugs-lane-step-4from
perf/lint-lane-step-5

Conversation

@joaodinissf

@joaodinissf joaodinissf commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Supersedes #1457 (recreated from an in-repo branch to form a native stacked-PR chain).

Note

Stacked on #1456. Earlier commits belong to the perf stack; review only the last two commits here.

Two reductions to the lint lane (~3.5 min in CI):

  1. CPD runs without a compile pass — CPD tokenizes sources under src/ and needs neither bytecode nor the target platform. cpd.xml outputs verified identical with and without compile, at both the current token threshold and the PMD default of 100 (so the result holds after chore: enable CPD detection (pmd.cpd.min → 100), de-dup and baseline #1397). Locally 6.8s vs 44.3s; the CI step was 53s of which ~40s was redundant recompilation.
  2. Selective lintcompute-spotbugs-skip.sh becomes compute-analysis-skip.sh <base-sha> <spotbugs|lint>: the lint mode injects pmd.skip/cpd.skip/checkstyle.skip into unchanged modules' poms and exports LINT_SCOPE_ARGS (-pl ../ddk-target,<changed> -am), mirroring the spotbugs lane (including the ddk-target reactor pin and the report-presence gate from ci: in-process SpotBugs + changed-modules-only reactor in the spotbugs lane #1456; only source-bearing bundles are expected to report, so a source-less branding bundle can never false-fail the gate). compile stays in the PMD/Checkstyle invocation (PMD's type-resolving rules need Tycho's aux-classpath; the -am-pulled unchanged dependencies compile but are not analysed). When no reactor module changed at all (e.g. a docs-only PR) both lint invocations and the SARIF upload are skipped entirely (LINT_KEPT=0) — the upload guard mirrors the spotbugs lane's, since upload-sarif fails on an empty merge directory. Fail-safes unchanged (the full-scan path exports KEPT=all so the workflow guard can never mistake it for the empty case), and changes under ddk-configuration/ (rulesets, filters) now trigger the full-scan path in both lanes.

Measurements

Regime Before After Δ
Full-scan regime, warm cache (this PR's runs vs the lint references) 199–219s 139–172s across runs −14–37% (CPD-without-compile)
Scoped run, one changed module, cold cache (fork probes vs same-conditions full lint) 288s 96–132s across runs (final-SHA runs 96–103s) −54–67%
Docs-only PR, no reactor module changed (fork probe) 288s (full lint) 10–13s −95%

Local (one changed module): PMD+Checkstyle invocation 11.7s vs 33.8s full, CPD 3.9s vs 20.1s, only the changed module reports, zero violations; CPD outputs identical at both token thresholds.

Code Scanning semantics: repo-wide alert state reflects the default branch, which receives no lint/spotbugs analyses (verify uploads on PR refs only), so a scoped upload that omits unchanged modules affects PR-context annotations only — the same property the spotbugs category has had since the per-module skip landed.

Merge chain: #1399 (merged) → #1396#1400#1456#1457 (this PR)#1397

🤖 Generated with Claude Code

joaodinissf and others added 2 commits August 3, 2026 23:35
CPD tokenizes sources under src/ and needs neither bytecode nor a
resolved target platform, so the second lint invocation drops its
compile goals. cpd.xml outputs are identical with and without the
compile pass, verified at the current token threshold and at the
PMD default of 100 (timestamp attributes aside).

Measured locally (warm tree, JDK 21): 6.8s vs 44.3s at the current
threshold; 4.5s vs 28.5s at threshold 100. In CI the invocation was
53s, ~40s of it redundant recompilation and JVM startup.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
compute-spotbugs-skip.sh becomes compute-analysis-skip.sh with a mode
argument: `spotbugs` injects spotbugs.skip as before, `lint` injects
pmd.skip, cpd.skip and checkstyle.skip, and each mode exports its
-pl/-am reactor scope args. The lint lane gains the scope step and
passes LINT_SCOPE_ARGS to both invocations; `compile` stays in the
PMD/Checkstyle invocation because PMD's type-resolving rules need
Tycho's aux-classpath (skip-injected -am dependencies compile but are
not analysed). Changes under ddk-configuration (rulesets, filters) now
also trigger the full-scan fail-safe in both lanes.

Code Scanning note: repo-wide alert state reflects the default branch,
which receives no lint/spotbugs analyses (verify runs on pull_request
only), so a scoped upload that omits unchanged modules can only affect
PR-context annotations — the same property the spotbugs category has
had since the per-module skip landed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@joaodinissf joaodinissf changed the title perf/lint lane step 5 ci: CPD without compile + changed-modules-only lint lane Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant